module.exports = {
  "stories": ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
  "addons": ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-mdx-gfm"],
  "framework": {
    name: "@storybook/react-webpack5",
    options: {}
  },
  docs: {
    autodocs: true
  },
  core: {
    builder: {
      name: '@storybook/builder-webpack5',
      options: {},
    },
  },
  webpackFinal: async (config) => {
    config.module.rules.push(
      {
        test: /\.less$/i,
        use: [
          { loader: 'style-loader' },
          {
            loader: 'css-loader', options: {
              modules: {
                localIdentName: '[local]',
                // mode: 'local',
              }
            }
          },
          {
            loader: 'less-loader',
            options: {
              implementation: require("less"),
              lessOptions: {
                javascriptEnabled: true
              }
            }
          },// NOTE implementation为了解决less-loader无法找到less的情况，没有该配置，在storybook下回出现问题
        ]
      }
    );
    return config;
  },
};